function [shiftedx] = ramanshift_rev(datax, exwave)
%       [shiftedx] = ramanshift_rev(datax, exwave)
%
% converts DATAX from Ramanshifts back into wavelength, using EXWAVE as the
% LASER wavelength. Based on the Formula
%
%       DeltaW = (1/Laser - 1/Signal)
%
%
% INPUT:    datax       = (1,x) array of wavelength data
%           exwave      = wavelength of exitation Laser
%
% OUTPUT:   shiftedx    = (1,x) array of shift data

%  (c) F. Dworkowski, 2012
%      Version 1.0, 2012-06-20

% Help if called without argument
if nargin < 2
    help ramanshift_rev
    return
end

if datax(1,1)>1                % conversion to (m)
     datax=datax/1e7;
end 
lengx = length(datax);
shiftedx = zeros(1,lengx);                      % predifne empty vector


%% Do vectorized Shifting
shiftedx = 1./((1/exwave)-datax);

%% Do itterative shifting
% figure(4)
% for i = 1:lengx
%     shiftedx(i) = 1/((1/exwave)-datax(i));
%     plot(shiftedx)
%     if rem(i,10) == 0
%         pause(0.001)
%     end
% end
